<div class="box-tools" style="top:10px;">
  <form class="form-inline" id="project—form" action="{:url('Hetong/melist')}" method="GET" pjax-search="">
    <div class="form-group">
      <label for="project_id">所属项目</label>
      <select class="form-control" name="project_id" id="project_id" style="border-radius:3px;">
        <option value="0">全部</option>
        {foreach name="projectList" item="pro"}
        <option value="{$pro.id}" {if condition="$pro.id eq input('get.project_id')" }selected="selected" {/if} >{$pro.project_name}</option>
        {/foreach}
      </select>
    </div>
    <div class="form-group">
      <label for="sign">签署状态</label>
      <select class="form-control" name="sign" id="sign" style="border-radius:3px;">
        <option value="-1">全部</option>
        <option value="3" {if condition=" input('get.sign') eq 3" }selected="selected" {/if} >签署成功</option>
        <option value="1" {if condition=" input('get.sign') eq 1" }selected="selected" {/if} >公司未签章</option>
        <option value="0" {if condition=" isset($_GET['sign']) && input('get.sign') eq 0" }selected="selected" {/if}>用户未签署</option>
      </select>
    </div>
    <div class="form-group">
      <label for="status">发放状态</label>
      <select class="form-control" name="status" id="status" style="border-radius:3px;">
        <option value="-1">全部</option>
        <option value="1" {if condition=" input('get.status') eq 1" }selected="selected" {/if} >已发送</option>
        <option value="0" {if condition=" isset($_GET['status']) && input('get.status') eq 0" }selected="selected" {/if} >未发送</option>
      </select>
    </div>
    <div class="form-group">
      <label for="search">关键字</label>
      <input type="text" name="search" id="search" class="form-control" value="{:input('get.search')}"
             placeholder="按会员名称搜索"/>
    </div>
    <div class="form-group">
      <button type="submit" class="btn btn-primary">搜索</button>
      <button type="button" id="dwonload" class="btn btn-primary sreachs">下载</button>
      <button type="button" class="btn btn-primary" onclick="resetForm()">重置</button>
    </div>
  </form>
</div>
<script>
  $(function () {
    $('#dwonload').click(function () {
      var url = "{:url('Hetong/melist')}";
      var project_id = $("select[name='project_id']").val();
      var sign = $("select[name='sign']").val();
      var status = $("select[name='status']").val();
      var search = $("input[name='search']").val();
      location.href = url + "?project_id=" + project_id + "&sign=" + sign + "&status=" + status + "&search=" + search + "&down=1";
    })
  })
    function resetForm() {
        $('select[name="project_id"]').val('0')
        $('select[name="sign"]').val('-1')
        $('select[name="status"]').val('-1')
        $('input[name="search"]').val('')
        $('#project—form').submit()
    }
</script>